package config

import (
	"common/helper"
	"database/sql"
)

/*
流水返利配置
*/

type CfgDepositReturnItem struct {
	Deposit    float64 `json:"deposit" db:"deposit" cbor:"deposit"`
	ReturnRate int     `json:"return_rate" db:"return_rate" cbor:"return_rate"`
}
type CsDepositReturnCfg struct {
}

var cfgDepositList []CfgDepositReturnItem

func (that *CsDepositReturnCfg) GetCfg() []CfgDepositReturnItem {
	return cfgDepositList
}

func DepositReturnCfgSetRow(rows *sql.Rows) {
	var tVal CfgDepositReturnItem
	var err error
	err = rows.Scan(&tVal.Deposit, &tVal.ReturnRate)
	if err != nil {
		helper.InfoLog("DepositReturnCfgSetRow scan err")
		return
	}

	cfgDepositList = append(cfgDepositList, tVal)
}

func DepositReturnCfgRemove() {
	cfgDepositList = []CfgDepositReturnItem{}
}
